<template>
<div class="ui form marginTop10">
	<mybind :field='field' @setVo='setSpid' fromMypop="1" v-if='bindShow'></mybind>
	<div class="center-box">
		<button class="ui primary button" @click.prevent.stop="sure">确认</button>
		<button class="ui button" @click.prevent.stop="hideMypop">取消</button>
	</div>
</div>
</template>
<script>
import tool from 'src/util/tool';
import util from '_util/index';
import logic from '_logic';

import mybind from 'components/field/bind'
import tFields from 'components/tunit/tFields'

export default {
    data() {
        return {
            val: null,
            nosubmit: true,
			bindShow : true,
			bindData:{
			}
        }
    },
    created(){
		window.pp = this
	},
    methods: {
        setSpid(sp, id, name) {
			this.bindData= {...this.bindData,sp,id,name}
        },
		hideMypop(){
			util.store.push(this, 'set_in_modal','in_modal',false,false,'global');
			this.$store.state.global.eventVue.$emit('hideMypop')
		},
		sure(){
			if(this.bindData){
				this.option.data.fn.sure(this.bindData);
				this.hideMypop()
			}
		},
        oncancel() {},
        onsubmit() {},
    },
	watch:{
	},
    computed: {
		field(){
			return this.option.data.field
		}
	},
    props:['option'],
    components: {
        tFields,
        mybind
    },

}
</script>
<style rel="stylesheet/less" scoped lang="less">
@import "../../common/style/mixin";
.center-box {
	text-align: center;
	width: 100%;
}
</style>
